package com.google.code.jholidays.events.properties;

import com.google.code.jholidays.core.EventDescriptor;
import com.google.code.jholidays.events.FloatingEvent;
import com.google.code.jholidays.events.FloatingEventFactory;
import com.google.code.jholidays.events.parameters.DateParameters;


/**
 * Encapsulates properties needed for construction of {@link FloatingEvent}
 * instances
 * 
 * @author tillias
 * @see FloatingEventFactory
 * @see FloatingEvent
 * 
 */
public class FloatingEventProperties extends AbstractEventProperties {

    /**
     * Creates new instance of properties
     * 
     * @param descriptor
     *            Event descriptor
     * @param dateParams
     *            Date parameters of floating event
     * @throws IllegalArgumentException
     *             Thrown if any parameter passed to constructor is null
     */
    public FloatingEventProperties(EventDescriptor descriptor,
	    DateParameters dateParams) throws IllegalArgumentException {
	super(descriptor, null);

	if (dateParams == null)
	    throw new IllegalArgumentException("Invalid date parameters");

	this.dateParameters = dateParams;
    }

    /**
     * Gets date parameters of floating event
     * 
     * @return Date parameters of floating event
     */
    public DateParameters getDateParameters() {
	return dateParameters;
    }

    DateParameters dateParameters;

}
